﻿//==============================================================================  
//Copyright (C) 2012-2015 9UN.ORG. All rights reserved. 
//GUID：b2096c56-e0c2-490e-bbba-2242446de6cc
//CLR Version: 4.0.30319.18033
//Code Author：Kevin Wang
//Contact：Email(Admin@9un.org),QQ(265382 or 74344)
//Filename：MatchContentType
//Namespace：RuanRang.Core.Utility
//Functions：MatchContentType  
//Created by Kevin Wang at 2013/2/4 20:33:26 http://blog.9un.org
//============================================================================== 

namespace RuanRang.Core.Utility
{
    public class MatchContentType
    {
        /// <summary>
        /// Matches the specified extension.
        /// </summary>
        /// <param name="extension">The extension.</param>
        /// <returns>System.String.</returns>
        public static string Match(string extension)
        {
            switch (extension.ToLower())
            {
                case ".mov":
                    return "video/quicktime";
                case ".m4v":
                    return "video/x-m4v";
                case ".avi":
                    return "video/x-msvideo";
                case ".mpg":
                    return "video/mpeg";
                case ".dvr-ms":
                    return "video/x-msvideo";
                case ".mp4":
                    return "video/mp4";
                case ".wmv":
                    return "video/x-ms-wmv";
                default:
                    return "application/octet-stream";
            }
        }
    }
}
